/**
 * Created by chenyong on 2015/7/16.
 */

var express = require('express');
var passport = require('passport');
var auth = require('../auth.service');
var crypto = require('crypto')

var router = express.Router();

router.get('/', passport.authenticate('weibo'));

router.get('/callback',
    passport.authenticate('weibo',
        {
            successRedirect:'/auth/success',
            failureRedirect: '/auth/failure',
            session:false
        }),
    auth.setTokenCookie
);

module.exports = router;